import React from 'react';
import {Link,Route} from 'react-router-dom';
import Fruit from './Fruit';
import Veg from './Veg';

export default class Goods extends React.Component{
        render(){
             console.log(this.props)
            return(
                <div>
                    <ul>
                        <Link to='/goods/fruit'>水果</Link><br/>
                        <Link to='/goods/veg'>蔬菜</Link>
                    </ul>
                    <Route path={`${this.props.match.url}/fruit`} component={Fruit}/>
                    <Route path={`${this.props.match.url}/veg`} component={Veg}/>
                </div>
            )
        }
}